//
// Created by Castle-Moriarty on 2025/11/4.
//

#include <iostream>
using namespace std;


// 基类
class Wukong {
public:
    virtual void ShowMe() {
        cout << "我是孙悟空原神" << endl;
    }
};

class Hudie : public Wukong {
public:
    void ShowMe() {
        cout << "I am Sunwukong hudie" << endl;
    }
};

class Xiaoyu : public Wukong {
public:
    void ShowMe() {
        cout << "i am Sunwukong xiaoyu" << endl;
    }
};

int main() {
    // 多态
    Wukong obj;
    Hudie hudiObj;
    Xiaoyu xiaoyuObj;

    Wukong *p = &hudiObj;
    p->ShowMe();
    p = &xiaoyuObj;
    p->ShowMe();


    return 0;
}
